<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>负边距</title>
    <style>
    
    * {
        padding: 0;
        margin: 0;
    }

    html,body {
        width: 100%;
        height: 100%;
    }

    .container {
        width: 800px;
        padding: 0 200px;
        height: 100px;
        border: 5px dashed #ccc;
        margin: 50px auto;
    }

    .container div {
        
        float: left;
        color: #fff;
    }

    .center {
        width: 100%;
        height: 100%;
        background: #096;
    }

    .left {
        width: 200px;
        height: 100%;
        background: #f40;
        margin-left: -100%;
        position: relative;
        left: -200px;
    }

    .right {
        width: 200px;
        height: 100%;
        background: #369;
        margin-left: -200px;
        position: relative;
        right: -200px;
    }
    
    </style>
</head>
<body>
    <div class="container">
        <div class="center">center</div>
        <div class="left">left</div>
        <div class="right">right</div>
    </div>
</body>
</html>